package string;

public class MatchesDemo {
    public static void main(String[] args) {
        //[A-Za-z0-9_]+@[a-z0-9A-Z]+(\.[A-Za-z]+)+
        String regex = "[a-zA-Z0-9_]+@[a-z0-9A-Z]+(\\.[A-Za-z]+)+";
        String email = "3047664314@qq.com";
        if (email.matches(regex)){
            System.out.println("是邮箱");
        }else {
            System.out.println("不是邮箱");
        }

    }
}
